﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Truextend.CoffeShop.Service.Infrastructure;
using Truextend.CoffeShop.Model;
using Truextend.CoffeShop.Bussiness;

namespace Truextend.CoffeShop.Service
{
    public class RestaurantService : BaseService
    {
        public IList<Restaurant> GetExternalRestaurant()
        {
            IList<Restaurant> result = null;

            ExecuteManager(uow =>
                            {
                                IRestaurantManager manager = new RestaurantManager(uow);
                                result = manager.GetAllExternalRestaurants();
                            });

            return result;
        }

        public Restaurant GetRestaurantByOrderId(int orderId)
        {
            Restaurant result = null;

            ExecuteManager(uow =>
                            {
                                IRestaurantManager manager = new RestaurantManager(uow);
                                result = manager.GetRestaurantByOrderId(orderId);
                            });

            return result;
        }
    }
}
